package utils;

import java.io.File;
import java.io.FilenameFilter;

public class GenerateId {
	
	public  static final double ponderationTermeInitial=1;
	public  static final double ponderationTermeAjoute=0.1;
	public  static final double ponderationEnvPertinent=0.6;
	public  static final double ponderationEnvNonPertinent=0.15;
	
	
	private static int idDoc=0;
	private static int idNoeud=0;
	private static int idTerme=0;
	
	public GenerateId(){
	}
	
	
	public static int generateIdDoc(){
		idDoc++;
		return idDoc; 
	}
	public static int generateIdNoeud(){
		idNoeud++;
		return idNoeud; 
	}
	public static int generateIdTerme(){
		idTerme++;
		return idTerme; 
	}
	
	public static File[] findFileListOfDir(String dirPath, final String regexp){
		File dir = new File(dirPath);   
		File[] list=dir.listFiles(new FilenameFilter () {
		    @Override
		    public boolean accept (File dir, String name) {
		     return name.matches(regexp);//"^d[0-9]+\\.xml$"
		    }
		   });
		return list;
	}
	
	

}
